from zyb_caps import *

# # id定位
# driver.find_element(By.ID, 'com.baidu.homework:id/passport_phone_number_input_edit').send_keys('18836413886')
# driver.find_element(By.ID, 'com.baidu.homework:id/passport_password_input_view').send_keys('liuyge123')
# driver.find_element(By.ID, 'com.baidu.homework:id/tv_phone_enter').click()
# sleep(3)

# # list定位
# driver.find_element(By.CLASS_NAME, 'android.widget.EditText').send_keys('18836413886')
# driver.find_element(By.CLASS_NAME, 'android.widget.EditText').send_keys('liuyge123')
# driver.find_element(By.CLASS_NAME, 'android.widget.TextView').click()
# sleep(3)

# # class定位
# driver.find_element(By.CLASS_NAME, 'android.widget.EditText').send_keys('18836413886')
# driver.find_element(By.CLASS_NAME, 'android.widget.EditText').send_keys('liuyge123')
# driver.find_element(By.CLASS_NAME, 'android.widget.TextView').click()
# sleep(3)

# # xpath定位 driver.find_element(By.XPATH, '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android
# .widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android
# .widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.RelativeLayout[
# 1]/android.widget.RelativeLayout/android.widget.EditText').send_keys('18836413886') driver.find_element(By.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget
# .FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget
# .ScrollView/android.widget.LinearLayout/android.widget.RelativeLayout[2]/android.widget.EditText').send_keys(
# 'liuyge123') driver.find_element(By.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget
# .FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget
# .ScrollView/android.widget.LinearLayout/android.widget.TextView[3]').click() sleep(3)

# 相对定位
driver.find_element(By.XPATH, '//android.widget.EditText[@text="输入手机号码"]').send_keys('18836413886')
driver.find_element(By.XPATH, '//android.widget.EditText[@text="请输入登录密码"]').send_keys('liuyge123')
driver.find_element(By.XPATH, '//android.widget.TextView').click()
sleep(3)

driver.quit()
